﻿<?php 
define( 'DAYS_TO_CACHE', 14 );	// cache this css page for a fortnight
define( 'CSS_PRECISION', 4 );	// after the decimal point, trim to

// CONFIGURE FROM GET VARIABLES
if ( is_numeric($_GET['width']) ) $width = $_GET['width'];	
if ( is_numeric($_GET['baseline']) ) $baseline = $_GET['baseline'];	
if ( isset($_GET[ 'print' ])&&!!$_GET[ 'print' ] ) $width = 480;	

// ADD CSS HEADER 
header('Content-type: text/css');
header('Expires: '.gmdate('D, d M Y H:i:s',time() + (60 * 60 * 24 * DAYS_TO_CACHE)).' GMT');	// set an expiration date
// Special Font Families ( Typeset and idea from http://cssfontstack.com/)
	// Sans Serif :
	/*
	// Arial
	define( 'FONTS_ARIAL', 'Arial, "Helvetica Neue", Helvetica, sans-serif' );

	// Arial Black
	define( 'FONTS_ARIAL_BLACK', '"Arial Black", "Arial Bold", Gadget, sans-serif' );

	// Arial Narrow
	define( 'FONTS_ARIAL_NARROW', '"Arial Narrow", Arial, sans-serif');

	// Arial Rounded
	define( 'FONTS_ARIAL_ROUNDED', '"Arial Rounded MT Bold", "Helvetica Rounded", Arial, sans-serif');

	// Avant Garde
	define( 'FONTS_AVANT_GARDE', '"Avant Garde", Avantgarde, "Century Gothic", CenturyGothic, "AppleGothic", sans-serif');

	// Calibri
	define( 'FONTS_CALIBRI', 'Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif');

	// Candara
	define( 'FONTS_CANDARA', 'Candara, Calibri, Segoe, "Segoe UI", Optima, Arial, sans-serif');

	// Century Gothic
	define( 'FONTS_CENTURY_GOTHIC', '"Century Gothic", CenturyGothic, "AppleGothic", sans-serif');

	// Franklin Gothic Medium
	define( 'FONTS_FRANKLIN_GOTHIC_MEDIUM', '"Franklin Gothic Medium", Arial, sans-serif');

	// Frutiger
	define( 'FONTS_FRUTIGER', 'Frutiger, "Frutiger Linotype", Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, sans-serif');

	// Futura
	define( 'FONTS_FUTURA', 'Futura, "Trebuchet MS", Arial, sans-serif');

	// Geneva
	define( 'FONTS_GENEVA', 'Geneva, Tahoma, Verdana, sans-serif');

	// Gill Sans
	define( 'FONTS_GILL_SANS', '"Gill Sans", "Gill Sans MT", Calibri, sans-serif');

	// Helvetica
	define( 'FONTS_HELVETICA', '"Helvetica Neue", Helvetica, Arial, sans-serif');

	// Impact
	define( 'FONTS_IMPACT', 'Impact, Haettenschweiler, "Franklin Gothic Bold", Charcoal, "Helvetica Inserat", "Bitstream Vera Sans Bold", "Arial Black", sans serif');

	// Lucida Grande
	define( 'FONTS_LUCIDA_GRANDE', '"Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif');

	// Optima
	define( 'FONTS_OPTIMA', 'Optima, Segoe, "Segoe UI", Candara, Calibri, Arial, sans-serif');

	// Segoe
	define( 'FONTS_SEGOE', 'Segoe, "Segoe UI", "Helvetica Neue", Arial, sans-serif');

	// Tahoma
	define( 'FONTS_TAHOMA', 'Tahoma, Verdana, Segoe, sans-serif');

	// Trebuchet
	define( 'FONTS_TREBUCHET', '"Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Tahoma, sans-serif');

	// Verdana
	define( 'FONTS_VERDANA', 'Verdana, Geneva, sans-serif');



	// Serif :

// Adobe Caslon Pro
define( 'FONTS_FUTURA', '"Adobe Caslon Pro", Baskerville, Georgia, Palatino, "Times New Roman", Times, serif');

// Baskerville
define( 'FONTS_FUTURA', 'Baskerville, "Baskerville old face", "Hoefler Text", Garamond, "Times New Roman", serif');

// Big Caslon
define( 'FONTS_FUTURA', '"Big Caslon", "Book Antiqua", "Palatino Linotype", Georgia, serif');

// Bodoni MT
define( 'FONTS_FUTURA', '"Bodoni MT", Didot, "Didot LT STD", "Hoefler Text", Garamond, "Times New Roman", serif');

// Book Antiqua
define( 'FONTS_FUTURA', '"Book Antiqua", Palatino, "Palatino Linotype", "Palatino LT STD", Georgia, serif');

// Calisto MT
define( 'FONTS_FUTURA', '"Calisto MT", "Bookman Old Style", Bookman, "Goudy Old Style", Garamond, "Hoefler Text", "Bitstream Charter", Georgia, serif');

// Cambria
define( 'FONTS_FUTURA', 'Cambria, Georgia, serif');

// Didot
define( 'FONTS_FUTURA', 'Didot, "Didot LT STD", "Hoefler Text", Garamond, "Times New Roman", serif');

// Garamond
define( 'FONTS_FUTURA', 'Garamond, Baskerville, "Baskerville Old Face", "Hoefler Text", "Times New Roman", serif');

// Goudy Old Style
define( 'FONTS_FUTURA', '"Goudy Old Style", Garamond, "Big Caslon", "Times New Roman", serif');

// Hoefler Text
define( 'FONTS_FUTURA', '"Hoefler Text", "Baskerville old face", Garamond, "Times New Roman", serif');

// Lucida Bright
define( 'FONTS_FUTURA', '"Lucida Bright", Georgia, serif');

// Palatino
define( 'FONTS_FUTURA', 'Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif');

// Perpetua
define( 'FONTS_FUTURA', 'Perpetua, Baskerville, "Big Caslon", "Palatino Linotype", Palatino, "URW Palladio L", "Nimbus Roman No9 L", serif');

// Times New Roman
define( 'FONTS_FUTURA', 'TimesNewRoman, "Times New Roman", Times, Baskerville, Georgia, serif');



// Slab Serif :

// Rockwell
define( 'FONTS_FUTURA', 'Rockwell, "Courier Bold", Courier, Georgia, Times, "Times New Roman", serif');

// Rockwell Extra Bold
define( 'FONTS_FUTURA', 'Rockwell Extra Bold, Rockwell Bold, monospace');


// Monospaced :

// Andale Mono
define( 'FONTS_FUTURA', '"Andale Mono", AndaleMono, monospace');

// Consolas
define( 'FONTS_FUTURA', 'consolas, monaco, monospace');

// Courier New
define( 'FONTS_FUTURA', '"Courier New", Courier, "Lucida Sans Typewriter", "Lucida Typewriter", monospace');

// Lucida Console
define( 'FONTS_FUTURA', '"Lucida Console", "Lucida Sans Typewriter", Monaco, "Bitstream Vera Sans Mono", monospace');

// Monaco
define( 'FONTS_FUTURA', 'monaco, consolas, "Lucida Console", monospace');

*/


//////////////////////////////////////////////////////////
// PARAGRAPHS
//////////////////////////////////////////////////////////
?>

/* Indented paragraphs */
<?php echo cssComment("Paragraph Layout Rules" , true, true); ?>
p + p {
    text-indent:<?php echo $baseline / $paragraphInPoints; ?>em;
    margin-top:0 
}

/* Drop Caps */
p:first-letter {
<?php echo "\n\t font-size: ".round( $paragraphInPoints*3 / EM_FONT_SIZE , CSS_PRECISION )."em; " ; ?> 
    font-weight: 400;
    float: left;
    margin-right:0.107em;
}
p:first-line {
    font-weight: 800;
}



/* Drop Caps on subsequent paragraphs */
p + p:first-letter {
<?php echo cssRules( $paragraphInPoints ); ?>
    float: none;
    margin: 0;
}

p + p:first-line {
    font-weight: 400;
}

